cmake_minimum_required(VERSION 3.5)

project(time_mcv VERSION 0.1
  DESCRIPTION "Tools for run MCV batch forecasts"
  LANGUAGES Fortran)
enable_language(Fortran)

if (CMAKE_Fortran_COMPILER_ID MATCHES GNU)
  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp -r8 -O3 -ffree-line-length-none -fno-range-check")
elseif (CMAKE_Fortran_COMPILER_ID MATCHES Intel)
  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp -r8 -O3 -no-wrap-margin")
endif ()

set(lib_codes
  src/time_manager_mod.f90
  src/utilities_mod.f90
  src/parse_args_mod.f90
  src/types_mod.f90)

add_library(time_lib ${lib_codes})
add_executable(advance_time.exe src/advance_time.f90)
target_link_libraries(advance_time.exe time_lib)
